// 	Name: 04.c
//	Description: Chapter 6 project 4
//	Author: StableGenius
//	Date: 2020-07-08
//	Email: feng@dongfa.pro

#include <stdio.h>

int main(void){
	float commission, value;
	
	printf("Enter value of trade: ");
	scanf("%f", &value);

    while (value) {
	    if (value < 2499.00f)
	    	commission = 29.00f + 0.017f * value;
        else if (value < 6249.00f)
            commission = 55.00f + .0066f * value;
        else if (value < 19999.00f)
            commission = 75.00f + .0034f * value;
        else if (value < 49999.00f)
            commission = 99.00f + .0022f * value;
        else if (value < 499999.00f) 
            commission = 154.00f + .0011f * value;
        else
            commission = 254.00f + .0009f * value;

        if (commission < 38.00f)
                commission = 38.00f;

        printf("Commission: $%.1f\n\nEnter value of trade: ", commission);
        scanf("%f", &value);
    }
	
	return 0;
}